<template>
    <div>
        <div v-for="user in info.users" :key='user.login'>
            <a target="_b" :href="user.html_url">
                <image :src="user.avatar_url" ></image>
                {{user.login}}
            </a>
        </div>
    </div>
</template>

<script>
    export default {
        name : "List",
        data(){
            return {
                info:{
                    isFirstLoading:true,
                    users:[]
                }
            }
        },
        mounted(){
            this.$bus.$on('getUsers',(info)=>{
                //ES6语法，意思是如果info.users里面没有这个属性，则填充，如果有，则不填充
                console.log('tag', '')
                this.info = {...this.info.isFirstLoading, ...info.users}
            })
        },
    }
</script>

<style scoped>

</style>
